Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTE deprecation #486

Merged
merged 3 commits into from
Jun 1, 2023
Merged

CTE deprecation #486

merged 3 commits into from
Jun 1, 2023

Conversation

neelasha23
Copy link

@neelasha23 neelasha23 commented May 12, 2023

Describe your changes

Deprecate --with when forming CTEs

Issue number

Closes #166

Checklist before requesting a review


📚 Documentation preview 📚: https://jupysql--486.org.readthedocs.build/en/486/

@neelasha23 neelasha23 changed the title CTE deprecation CTE deprecation - WIP May 12, 2023
@neelasha23 neelasha23 marked this pull request as draft May 12, 2023 12:45
@neelasha23 neelasha23 force-pushed the cted branch 2 times, most recently from c2bfe3e to 7331258 Compare May 22, 2023 10:31
@neelasha23
Copy link
Author

Covered most of the test cases I could think of. Still testing to check for bugs. Meanwhile, one round of review would be helpful.

@edublancas @idomic

Also, there is a circular dependency issue whenever util.py is imported in some of the modules. So had to create separate module, e.g., query_util.py for now.

ImportError while loading conftest '/Users/neelashasen/Dev/jupysql/src/tests/conftest.py'.
src/tests/conftest.py:8: in <module>
    from sql.magic import SqlMagic, RenderMagic
../../miniforge3/envs/jupysql/lib/python3.10/site-packages/sql/__init__.py:1: in <module>
    from .magic import RenderMagic, SqlMagic, load_ipython_extension
../../miniforge3/envs/jupysql/lib/python3.10/site-packages/sql/magic.py:22: in <module>
    import sql.connection
../../miniforge3/envs/jupysql/lib/python3.10/site-packages/sql/connection.py:11: in <module>
    from sql.store import store
../../miniforge3/envs/jupysql/lib/python3.10/site-packages/sql/store.py:12: in <module>
    from sql import util
../../miniforge3/envs/jupysql/lib/python3.10/site-packages/sql/util.py:1: in <module>
    from sql import inspect
../../miniforge3/envs/jupysql/lib/python3.10/site-packages/sql/inspect.py:4: in <module>
    from sql.connection import Connection
E   ImportError: cannot import name 'Connection' from partially initialized module 'sql.connection' (most likely due to a circular import) (/Users/neelashasen/miniforge3/envs/jupysql/lib/python3.10/site-packages/sql/connection.py)

@neelasha23 neelasha23 marked this pull request as ready for review May 23, 2023 15:14
@neelasha23 neelasha23 changed the title CTE deprecation - WIP CTE deprecation May 24, 2023
Copy link

@yafimvo yafimvo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments

General notes

  1. I think we can test the util functions as well (e.g. get_key_dependents, del_saved_key, del_all_saved_keys)
  2. There is missing documentation for some of the functions

doc/api/magic-snippets.md Outdated Show resolved Hide resolved
doc/api/magic-snippets.md Outdated Show resolved Hide resolved
src/sql/magic_cmd.py Outdated Show resolved Hide resolved
src/sql/magic_cmd.py Outdated Show resolved Hide resolved
src/sql/magic_cmd.py Outdated Show resolved Hide resolved
src/tests/test_magic_cmd.py Outdated Show resolved Hide resolved
src/tests/test_magic_cmd.py Outdated Show resolved Hide resolved
src/sql/util.py Outdated Show resolved Hide resolved
src/tests/test_magic_plot.py Show resolved Hide resolved
src/tests/test_magic_cmd.py Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
doc/compose.md Outdated Show resolved Hide resolved
src/sql/__init__.py Outdated Show resolved Hide resolved
src/sql/command.py Show resolved Hide resolved
src/sql/magic.py Outdated Show resolved Hide resolved
src/sql/magic_cmd.py Outdated Show resolved Hide resolved
src/sql/magic_plot.py Outdated Show resolved Hide resolved
src/sql/store.py Show resolved Hide resolved
src/tests/conftest.py Show resolved Hide resolved
src/tests/test_compose.py Outdated Show resolved Hide resolved
@tonykploomber
Copy link

By the way, do we need to take telemetry into this?

@neelasha23
Copy link
Author

Added some comments

General notes

  1. I think we can test the util functions as well (e.g. get_key_dependents, del_saved_key, del_all_saved_keys)
  2. There is missing documentation for some of the functions

Added unit tests and docstrings

Copy link

@edublancas edublancas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comments

src/sql/magic.py Show resolved Hide resolved
src/sql/magic_cmd.py Show resolved Hide resolved
@edublancas
Copy link

there's no need to add telemetry because this isn't adding any new options (it's automatically executed whenever a SQL snippet runs)

@neelasha23
Copy link
Author

Fixed all the review comments.
@edublancas @yafimvo

tonykploomber
tonykploomber previously approved these changes May 30, 2023
Copy link

@tonykploomber tonykploomber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

Copy link

@yafimvo yafimvo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added minor notes. besides that lgtm.

src/tests/test_magic_cmd.py Show resolved Hide resolved
doc/api/magic-snippets.md Outdated Show resolved Hide resolved
doc/compose.md Outdated Show resolved Hide resolved
src/sql/magic.py Show resolved Hide resolved
src/sql/sqlcmd.py Show resolved Hide resolved
src/sql/sqlcmd.py Show resolved Hide resolved
src/sql/util.py Outdated Show resolved Hide resolved
src/tests/test_extract_tables.py Show resolved Hide resolved
@neelasha23 neelasha23 force-pushed the cted branch 2 times, most recently from 20e2420 to 5a3cb4e Compare May 31, 2023 14:34
edublancas
edublancas previously approved these changes Jun 1, 2023
Copy link

@edublancas edublancas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just rebase, update the changelog entry and fix merge conflicts

CHANGELOG.md Outdated Show resolved Hide resolved
CTE depr

Warning msg, sqlglot

Lint

tests

warn test

conditions for extract

Empty commit

removed with test

exception handling

Fixed tests

Lint

typo error

test

condition for typo

suggestions

plot changes

merge conflict

fix test

Fix test

fix test

tests

list of with

sqlcmd delete

sqlcmd tests

rebase

Fixes

fixed

test fixes

removed test

non-existent tbl Test fix

fix typo test

fix typo test

space removed

delete snippet test

test fix

Docs

docs

toc

changelog modified

args modified

versionchanged added

message changed

tests

sqlcmd added

deprecation warning changed

tests

depr warning

removed if exists

debug prints

added clean_conns

rebase

test fix

rebase issues

revert error msg

test for snippet utils

telemetry removed

Minor changes

Moved string

refactor

plot tests

plot_typo

Renamed test file

Removed line

test fix

test fix

Review comments

added issue numbers

rebase

lint
@edublancas edublancas merged commit 6ac6f73 into ploomber:master Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically inferring dependencies in CTE feature
4 participants